﻿using Microsoft.AspNetCore.Mvc;
using StackExchange.Redis;

namespace redis_microservice.Controllers
{
    public class OtherController(IConnectionMultiplexer connection) : BaseController(connection)
    {
        /// <summary>
        /// 删除 Key
        /// </summary>
        [HttpPost]
        public async Task<IActionResult> DelKey(string key)
        { 
            bool res = await _db0.KeyDeleteAsync(key); // 返回 false 表示 Key 不存在
            return Ok(res);
        }
    }
}
